package me.yushuai.wukong.base.entity;

import lombok.*;
import me.yushuai.wukong.common.domain.AbstractAudit;
import org.hibernate.Hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author zhoushuai@189.cn
 * @TableName BAS_HS_CODE
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "BAS_HS_CODE")
public class HsCode extends AbstractAudit implements Serializable {

    public static final String HS_CODE = "hsCode";

    public static final String HS_CODE_ID = "hsCodeId";

    /**
     * 海关编号
     */
    @Id
    @Column(name = "HS_CODE_ID")
    private Long hsCodeId;

    /**
     * 海关编码
     */
    @Column(name = "HS_CODE")
    private String hsCode;

    /**
     * 中文描述
     */
    @Column(name = "DESC_CH")
    private String descCh;

    /**
     * 英文描述
     */
    @Column(name = "DESC_EN")
    private String descEn;

    /**
     * 用户自定义1
     */
    @Column(name = "UDF1")
    private String udf1;

    /**
     * 用户自定义2
     */
    @Column(name = "UDF2")
    private String udf2;

    /**
     * 用户自定义3
     */
    @Column(name = "UDF3")
    private String udf3;

    /**
     * 用户自定义4
     */
    @Column(name = "UDF4")
    private String udf4;

    /**
     * 用户自定义5
     */
    @Column(name = "UDF5")
    private String udf5;

    /**
     * 用户自定义6
     */
    @Column(name = "UDF6")
    private String udf6;

    /**
     * 用户自定义7
     */
    @Column(name = "UDF7")
    private String udf7;

    /**
     * 用户自定义8
     */
    @Column(name = "UDF8")
    private String udf8;

    /**
     * 用户自定义9
     */
    @Column(name = "UDF9")
    private String udf9;

    /**
     * 用户自定义10
     */
    @Column(name = "UDF10")
    private String udf10;

    /**
     * 用户自定义11
     */
    @Column(name = "UDF11")
    private String udf11;

    /**
     * 用户自定义12
     */
    @Column(name = "UDF12")
    private String udf12;

    /**
     * 用户自定义13
     */
    @Column(name = "UDF13")
    private String udf13;

    /**
     * 用户自定义14
     */
    @Column(name = "UDF14")
    private String udf14;

    /**
     * 用户自定义15
     */
    @Column(name = "UDF15")
    private String udf15;

    /**
     * 用户自定义16
     */
    @Column(name = "UDF16")
    private String udf16;

    /**
     * 用户自定义17
     */
    @Column(name = "UDF17")
    private String udf17;

    /**
     * 用户自定义18
     */
    @Column(name = "UDF18")
    private String udf18;

    /**
     * 用户自定义19
     */
    @Column(name = "UDF19")
    private String udf19;

    /**
     * 用户自定义20
     */
    @Column(name = "UDF20")
    private String udf20;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) {
            return false;
        }
        HsCode hsCode = (HsCode) o;
        return hsCodeId != null && Objects.equals(hsCodeId, hsCode.hsCodeId);
    }

    @Override
    public int hashCode() {
        return getClass().hashCode();
    }
}